// 雷达工作数据
package robot

import (
	"context"

	"device-admin/internal/app/grpc/protoc/robotc"
)

// PrimitivePointCloud2Server 雷达点云
func (s *Server) PrimitivePointCloud2Server(ctx context.Context, data *robotc.NotifyPrimitivePointCloud) (*robotc.RspPrimitivePointCloud, error) {
	// robotID := GetRobotID(ctx)
	// if robotID == "" {
	// 	return &robotc.RspPrimitivePointCloud{NVoid: 0}, nil
	// }

	// // 缓存并发布实时数据
	// dataBytes, err := proto.Marshal(data)
	// if err != nil {
	// 	logx.Error(context.Background(), "PrimitivePointCloud2Server", logx.Err(err))
	// 	return &robotc.RspPrimitivePointCloud{NVoid: 0}, nil
	// }
	// cache.HSet(define.CacheRobotRTInfo+robotID, "primitive_point_cloud", dataBytes, 0, nil)
	// go PublishRobotRealtimeInfo(ctx, "point_cloud")
	return &robotc.RspPrimitivePointCloud{NVoid: 0}, nil
}
